package com.deneme.ozveri.clicklisteners;

import java.util.ArrayList;

import com.deneme.ozveri.activities.LoginScreenActivity;
import com.deneme.ozveri.activities.OrderDetailActivity;
import com.deneme.ozveri.admin.AdminActivity;
import com.deneme.ozveri.application.OzveriMenuApplicationObject;
import com.deneme.ozveri.database.DBHandler;
import com.deneme.ozveri.objects.MenuOrderItem;

import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;

public class OrderItemOnClickListener implements OnItemClickListener {
	
	Activity act;
	DBHandler dh;
	ArrayList<MenuOrderItem> list;
	
	public OrderItemOnClickListener(Activity actvt, DBHandler databasehandler, ArrayList<MenuOrderItem> orderList) {
		act = actvt;
		dh = databasehandler;
		list = orderList;
	}

	@Override
	public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
		
		
		Intent intent = new Intent(act, OrderDetailActivity.class);
		intent.putExtra("id", list.get(arg2).getOrderId());
		act.startActivity(intent);
		
	}

}
